import unittest
import itk
import numpy as np
import numpy.random as ra
#from ..ITKUtils import io
#from ..ITKUtils import query
import imageTools.ITKUtils.io as io
import imageTools.ITKUtils.query as query

class imageTools_test(unittest.TestCase):
    def setUp(self):
        # create a sample image in memory
        self.array = ra.normal(100,10,(16,64,64)).astype(np.uint8)
        self.img = itk.PyBuffer.IUC3.GetImageFromArray(self.array)
        self.odir="data"
    def tearDown(self):
        self.img = 0

    def test_getImageType(self):
        assert query.getImageType(self.img)
    def test_getImgSize1(self):
        assert query.getImgSize(self.img,returnITK=False) == [64,64,16]
    def test_getImgSize2(self):
        r = query.getImgSize(self.img)
        assert query.get_itkSize(r) == [64,64,16]
    def test_getITKDirection(self):
        assert query.getITKDirection(self.img).any()
def run():
    pass
    
